package nju.mscs.server.businessLogic;
import java.util.Iterator;

import nju.mscs.data.DataServerManager;
import nju.mscs.data.object.*;

public class LogIn {
	private User user;
	static Database db;//现有一个数据库
	public LogIn(){
		db=Controller.sumDB;
	}
	public int matching(String id,String password,int type){	
		System.out.println("SADS:"+type);		
	    if((user=db.searchUserById(id))!=null&&user.getPassword().equals(password)&&user.getType()==type){
	    	new BackStage();
	    	System.out.println("SADS:"+type);
	    	return 1;
	    	}
	    	return 0;
	}
}

